package com.example.sys.wx.controller;


import com.example.core.utils.Result;
import com.example.sys.org.service.SysUserService;
import com.example.sys.org.vo.SysUserVo;
import com.example.sys.wx.vo.SysWxUserVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("wx")
@RestController
public class SysWxUserController {

    @Resource
    private SysUserService sysUserService;

    @RequestMapping("register")
    public Result register(@RequestBody SysWxUserVo sysWxUserVo) {
        try {
            return Result.success();
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }

    @RequestMapping("update")
    public Result update(@RequestBody SysUserVo sysUserVo) {
        try {
            this.sysUserService.add(sysUserVo);
            return Result.success();
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
}
